# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=python-sphinxcontrib-trio
_pyname=${pkgname/python-/}
pkgver=1.1.2
pkgrel=5
pkgdesc='Make Sphinx better at documenting Python functions and methods'
url='https://github.com/python-trio/sphinxcontrib-trio'
arch=('any')
license=('MIT')
depends=('python' 'python-sphinx')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-lxml' 'python-cssselect')
source=(https://github.com/python-trio/sphinxcontrib-trio/archive/v${pkgver}/${_pyname}-${pkgver}.tar.gz)
sha512sums=('490511ce953e0589759af7fd98dbfe1e9875c9bf3ca0046491fd0cbf25cec37fe5c343a4eacce5e9db3e9e0aca23a9ab7993fb19dd77b7bf95cc38e7ff2911ff')

build() {
  cd ${_pyname}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pyname}-${pkgver}
  # https://github.com/python-trio/sphinxcontrib-trio/issues/260
  PYTHONPATH=. py.test -k 'not test_end_to_end'
}

package() {
  cd ${_pyname}-${pkgver}
  python setup.py install -O1 --root="${pkgdir}" --skip-build
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
